package cn.edu.sdjzu.xg23.kcsj01_backend.controller;
import cn.edu.sdjzu.xg23.kcsj01_backend.controller.*;

import cn.edu.sdjzu.xg23.kcsj01_backend.service.*;
import cn.edu.sdjzu.xg23.kcsj01_backend.utils.*;
import cn.edu.sdjzu.xg23.kcsj01_backend.entity.*;
import cn.edu.sdjzu.xg23.kcsj01_backend.mapper.*;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
public class EmployeeAsPaperController {
        @Autowired
        private EmployeeAssPaperService  employeeAssPaperService;

        @PostMapping("employeesAsPaper/search")
        public Result get(@RequestParam(defaultValue = "1") Integer pageNum,
                          @RequestParam(defaultValue = "10") Integer pageSize,
                          @RequestBody(required = false) EmployeeAssPaper employeeAssPaper) {
            return Result.success(employeeAssPaperService.get(pageNum,pageSize,employeeAssPaper));
        }

        @PostMapping("employeesAsPaper")
        public Result save(@RequestBody EmployeeAssPaper employeeAssPaper) {
            return Result.success(employeeAssPaperService.save(employeeAssPaper));
        }
        @PutMapping("employeesAsPaper")
        public Result update(@RequestBody EmployeeAssPaper employeeAssPaper) {
            return Result.success(employeeAssPaperService.update(employeeAssPaper));
        }
        @DeleteMapping("employeesAsPaper/{id}")
        public Result delete(@PathVariable Long id) {
            return Result.success(employeeAssPaperService.delete(id));
        }

}
